<template>
    <section>
        <sy-baselist
                ref="delivery_confirm"
                editVue="./business/Delivery_Confirm_Edit.vue"
                :filters="filters"
                listUrl="server/business/Delivery.ashx?cmd=GetConfirmList"
                @onLoadRow="onLoadRow"
                :fixWhere="fixWhere"
                :hideDel="true"
                :hideAdd="true"
        >
            <el-table-column prop="FApplyNo" label="采购单编号" width="150">
            </el-table-column>
            <el-table-column prop="FDeliveryTime" align="center"   header-align="center" label="发货时间"  width="180" >
            </el-table-column>
            <el-table-column prop="ProjectName" align="center"  header-align="center" label="项目名称"  width="180" >
            </el-table-column>
            <el-table-column prop="UserName" align="center"  header-align="center" label="发货人"  width="180" >
            </el-table-column>
            <el-table-column prop="ConfirmStatus" label="状态" width="100">
            </el-table-column>
        </sy-baselist>
    </section>
</template>

<script>
    import util from '../../common/util'
    export default {
        data(){
            return {
                dvApprove:false,
                fixWhere:'',
                filters:[]
            }
        },
        methods:{
            onLoadRow(row)
            {
                row.FDeliveryTime = util.date.format(row.FDeliveryTime,'yyyy-MM-dd')
                switch(row.FIsConfirm)
                {
                    case 0: row.ConfirmStatus="未确认" ; break;
                    case 1: row.ConfirmStatus="已确认" ; break;
                    default: row.StatusName='未知'
                }
                if(row.FShippingUser==global.user.FID||global.user.FID==-1){
                    if(row.FIsConfirm==1)
                    {
                        row.editTitle="查看"
                    }
                    else
                    {
                        row.editTitle= "确认收货"
                    }
                }
                else {
                    row.editTitle="查看"
                }
            },
            init(){
                    this.fixWhere='FApproveStatus=3'
                    this.filters=[
                        {type: "string",name:"FApplyNo",text:"采购单编号"},
                        {type: "checkbox",name:"FIsConfirm",text:"状态", value:[[0,"未确认",false],
                            [1,"已确认",false]]}]

            }
        },
        created(){
            this.init()
        }
    }
</script>